package com.hs.service.impl;

import com.hs.entity.Ggao;
import com.hs.entity.Grade;
import com.hs.mapper.GgaoMapper;
import com.hs.service.GgaoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class GgaoServiceImpl implements GgaoService {
    @Autowired
    private GgaoMapper ggaoMapper;
    //查询公告信息列表
    @Override
    public List<Ggao> findGgaoList(String searchKey) {
        return ggaoMapper.findGgaoList(searchKey);
    }
    //查询公告信息列表
    @Override
    public List<Ggao> findGgaoList2(String searchKey) {
        return ggaoMapper.findGgaoList2(searchKey);
    }
    //根据id查找公告信息
    @Override
    public Ggao findGgaoById(Integer id){
        return ggaoMapper.selectByPrimaryKey(id);
    }

    //保存编辑公告
    @Override
    public Integer saveeditggao(Integer id, String title, String text){
        return ggaoMapper.saveeditggao(id,title,text);
    }

    //发布公告
    @Override
    public Integer saveggao(String teacherid,String title, String text){
        return ggaoMapper.saveggao(teacherid,title,text);
    }

    //撤回公告
    public Integer cancleggao(Integer id){
        return ggaoMapper.cancleggao(id);
    }

    //审核通过公告
    public Integer passggao(Integer id){
        return ggaoMapper.passggao(id);
    }
    //驳回公告
    public Integer nopassggao(Integer id){
        return ggaoMapper.nopassggao(id);
    }

}
